package routers

import (
	"gin-project-01/gin-step02/gin11-file-upload-example/controllers/user"
	middlewares2 "gin-project-01/gin-step02/gin11-file-upload-example/middlewares"
	"github.com/gin-gonic/gin"
)

func UserRouters(r *gin.Engine) {
	//路由分组中间件使用方式二
	routers := r.Group("/user")
	routers.Use(middlewares2.SaveAccessLog, middlewares2.UserMiddleWare01, middlewares2.UserMiddleWare02)
	{

		//使用自定义控制器,结构体实例化调用
		routers.GET("/", user.UserController{}.Index)

		routers.GET("/get", user.UserController{}.Detail)

		routers.GET("/del", user.UserController{}.Delete)

		routers.GET("/add", user.UserController{}.Add)
	}
}
